home *** CD-ROM | disk | FTP | other *** search
-
-
-
- SHMOP C Library Procedures SHMOP
-
-
-
- NNAAMMEE
- shmop, shmat, shmdt - shared memory operations
-
- SSYYNNOOPPSSIISS
- ##iinncclluuddee <<ssyyss//ttyyppeess..hh>>
- ##iinncclluuddee <<ssyyss//iippcc..hh>>
- ##iinncclluuddee <<ssyyss//sshhmm..hh>>
-
- cchhaarr **sshhmmaatt((sshhmmiidd,, sshhmmaaddddrr,, sshhmmffllgg))
- iinntt sshhmmiidd;;
- cchhaarr **sshhmmaaddddrr;;
- iinntt sshhmmffllgg;;
-
- iinntt sshhmmddtt((sshhmmaaddddrr))
- cchhaarr **sshhmmaaddddrr;;
-
- DDEESSCCRRIIPPTTIIOONN
- sshhmmaatt(()) maps the shared memory segment associated with the
- shared memory identifier specified by _s_h_m_i_d into the data
- segment of the calling process. Upon successful completion,
- the address of the mapped segment is returned.
-
- The shared memory segment is mapped at the address specified
- by one of the following criteria:
-
- o+ If _s_h_m_a_d_d_r is equal to zero, the segment is mapped at
- an address selected by the system. Ordinarily, appli-
- cations should invoke sshhmmaatt(()) with _s_h_m_a_d_d_r equal to
- zero so that the operating system may make the best use
- of available resources.
-
- o+ If _s_h_m_a_d_d_r is not equal to zero and (_s_h_m_f_l_g & SSHHMM__RRNNDD)
- is ``true'', the segment is mapped at the address given
- by (_s_h_m_a_d_d_r - (_s_h_m_a_d_d_r modulus SSHHMMLLBBAA)).
-
- o+ If _s_h_m_a_d_d_r is not equal to zero and (_s_h_m_f_l_g & SSHHMM__RRNNDD)
- is ``false'', the segment is mapped at the address
- given by _s_h_m_a_d_d_r.
-
- The segment is mapped for reading if (_s_h_m_f_l_g & SSHHMM__RRDDOONNLLYY)
- is ``true'' {{RREEAADD}}, otherwise it is mapped for reading and
- writing {{RREEAADD//WWRRIITTEE}}.
-
- sshhmmddtt(()) unmaps from the calling process's address space the
- shared memory segment that is mapped at the address speci-
- fied by _s_h_m_a_d_d_r. The shared memory segment must have been
- mapped with a prior sshhmmaatt(()) function call. The segment and
- contents are retained until explicitly removed by means of
- the function (see sshhmmccttll(2)).
-
- RREETTUURRNN VVAALLUUEESS
- Upon successful completion, the return values are as
-
-
-
- Sprite v1.0 21 November 1987 1
-
-
-
-
-
-
- SHMOP C Library Procedures SHMOP
-
-
-
- follows:
-
- o+ sshhmmaatt(()) returns the data segment start address of the
- mapped shared memory segment.
-
- o+ sshhmmddtt(()) returns a value of 0.
-
- Otherwise, a value of -1 is returned and eerrrrnnoo is set to
- indicate the error.
-
- EERRRROORRSS
- sshhmmaatt(()) will fail and not map the shared memory segment if
- one or more of the following are true:
-
- EINVAL _s_h_m_i_d is not a valid shared memory iden-
- tifier.
-
- EACCES Operation permission is denied to the
- calling process (see iinnttrroo(2)).
-
- ENOMEM The available data space is not large
- enough to accommodate the shared memory
- segment.
-
- EINVAL _s_h_m_a_d_d_r is not equal to zero, and the
- value of (_s_h_m_a_d_d_r - (_s_h_m_a_d_d_r modulus
- SSHHMMLLBBAA)) is an illegal address.
-
- EINVAL _s_h_m_a_d_d_r is not equal to zero, (_s_h_m_f_l_g &
- SSHHMM__RRNNDD) is ``false'', and the value of
- _s_h_m_a_d_d_r is an illegal address.
-
- EMFILE The number of shared memory segments
- mapped to the calling process would
- exceed the system-imposed limit.
-
- sshhmmddtt(()) will fail and not unmap the shared memory segment
- if:
-
- EINVAL
- _s_h_m_a_d_d_r is not the data segment start address of a
- shared memory segment.
-
- SSEEEE AALLSSOO
- eexxeeccvvee(2), eexxiitt(2), ffoorrkk(2), iinnttrroo(2), sshhmmccttll(2), sshhmmggeett(2)
-
- BBUUGGSS
- The System V shared memory functions are implemented at user
- level on top of the mmap(2) interface. Not all the System V
- functionality is implemented.
-
-
-
-
-
- Sprite v1.0 21 November 1987 2
-
-
-
-